1. Field of the Invention
The invention relates in general to scheduling on computer systems, and more particularly, to an object-oriented, prioritized work thread pool framework.
2. Description of Related Art
In modem computer systems, tasks are typically performed in parallel to increase the performance of computer programs. One such method for performing tasks in parallel is to use multi-threaded programming.
In multi-threaded programming, the execution of a computer program is divided into multiple threads, where a thread is a stream of instructions executed by the computer on behalf of the computer program. Typically, each thread is dispatched separately, and may be executed by a separate processor in a Massively Parallel Processor (MPP) computer system, to perform the task associated with that thread.
Current programming techniques also incorporate object-oriented programming techniques that allow for the creation of classes and instances within classes to organize and delineate methods and attributes. The merger of object-oriented programming and multi-threaded programming creates problems, however, because the management of the multiple threads and their interaction with the object classes and instances becomes difficult. Further, creation of threads as needed generates random threads, which are inefficient and creates programming errors.
It can be seen, then, that there is a need in the art for a managed multi-threaded programming system. It can also be seen, then, that there is a need in the art for a multi-threaded programming system that can be integrated with an object-oriented system. Further, it can be seen that there is a need in the art for managing efficiency and thread safety in a multi-threaded programming system.
To overcome the limitations in the prior art described above, and to overcome other limitations that will become apparent upon reading and understanding the present specification, the present invention discloses a method, apparatus, and article of manufacture for scheduling thread execution in a computer. First, a task queue and a work crew class are defined in the computer. The work crew class contains workers to complete the tasks. The computer also creates threads to connect the workers to the tasks in the task queue, and manages the creation of threads to prioritize the execution of the tasks. The present invention uses object oriented programming techniques to create and delete instances of tasks, workers, and work crews (groups of workers). The present invention ensures proper and safe thread creation and independently manages work crew objects to prioritize the execution of tasks in the task queue.
These and various other advantages and features of novelty which characterize the invention are pointed out with particularity in the claims annexed hereto and form a part hereof. However, for a better understanding of the invention, its advantages, and the objects obtained by its use, reference should be made to the drawings which form a further part hereof, and to the accompanying detailed description, in which there is illustrated and described specific examples of a method, apparatus, and article of manufacture in accordance with the invention.